import FormItem from "antd/es/form/FormItem";
import {Radio} from "antd";
import {RadioProps} from "./dev.tsx";

const RadioProd = (props:RadioProps) => {
    const {options,styles} = props
    return (
        <div style={styles}>
            <FormItem>
                <FormItem  label={props.label} name={props.name} rules={props.rule} style={{margin:"0",...styles}}>
                    <Radio.Group {...props as any} >
                        {
                            options && options.map((item:any,index:number)=>{
                                return <Radio  key={item.value+"-" + index} value={item.value}>{item.label}</Radio>
                            })
                        }
                    </Radio.Group>
                </FormItem>
            </FormItem>
        </div>
    );
};

export default RadioProd;